-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scan for Vulnerabilities + make PRs automatically #675
Conversation
make update-dependencies; | ||
exit 1 | ||
- name: Create Pull Request | ||
if: ${{ failure() }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we want to do this on success, not failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous command succeeds if there are no vulnerabilities and fails if there are vulnerabilities.
scan.json | sed 'N;s/\n/>=/'); | ||
|
||
make update-dependencies; | ||
exit 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we exiting 1
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exiting 1 to fail and ensure that the PR is created. Otherwise, everything would return 0 and no PR would be created.
sed -i "/${package}.*/d" ckan/requirements.in | ||
sed -i "/${package}.*/d" ckan/requirements.txt | ||
echo $fix >> ckan/requirements.in | ||
done <<< $(jq -r '.vulnerabilities[] | .moduleName,.fixedIn[]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if there's no fix, does this for loop run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there's no fix, we are testing what will happen, most likely a bad PR will be created.. But in that case, we'd have to make a PR to ignore it, we can add the functionality in the future. But I feel like that doesn't happen often.
Superseded by |
Related to
References: